<?PHP
  $current_page = "event_create.php";
  $page_type = "S";
  require_once 'header.php';
?>
	<div id="page">
	  <div id="page-padding">
        <!-- start content -->	    
	    <div id="content">
	      <div id="content-padding">
            <h1>Create Event</h1>
            <p>
			<?PHP
			
				$new_sid = "";
				$new_eid = "";
				$new_ename = "";
				$new_description = "";
				$new_stime = "";
				$new_etime = "";
				$new_lcname = "";
				$new_street = "";
				$new_city = "";
				$new_state = "";
				$new_zip = "";
				
				if (isset($_POST["new_sid"]))
					$new_sid = $_POST["new_sid"];
				if (isset($_POST["new_eid"]))
					$new_eid = $_POST["new_eid"];
				if (isset($_POST["new_ename"]))
					$new_ename = $_POST["new_ename"];
				if (isset($_POST["new_description"]))
					$new_description = $_POST["new_description"];
				if (isset($_POST["new_stime"]))
					$new_stime = $_POST["new_stime"];
				if (isset($_POST["new_etime"]))
					$new_etime = $_POST["new_etime"];
				if (isset($_POST["new_lcname"]))
					$new_lcname = $_POST["new_lcname"];
				if (isset($_POST["new_street"]))
					$new_street = $_POST["new_street"];
				if (isset($_POST["new_city"]))
					$new_city = $_POST["new_city"];
				if (isset($_POST["new_state"]))
					$new_state = $_POST["new_state"];
				if (isset($_POST["new_zip"]))
					$new_zip = $_POST["new_zip"];


				
				$sql = "insert into EVENT(UserID, EventID, Ename, Description, LCName, Street, City, State, Zip, S_Time, E_Time) values ('$new_sid', '$new_eid', '$new_ename', '$new_description', '$new_lcname', '$new_street', '$new_city', '$new_state', '$new_zip', '$new_stime', '$new_etime')";
				$result_array = execute_sql_in_oracle($sql);
				$result = $result_array["flag"];
				$cursor = $result_array["cursor"];
				if (!$result){
					$create_error = "<br>Event $new_eid insert failed.<br>";
					$sql = "rollback";
					$result_array = execute_sql_in_oracle($sql);
					$result = $result_array["flag"];
					header("Location:event.php?create_error=$create_error");
				}
				else {
					
					echo("Creation Successful!");
					$sql = "commit";
					$result_array = execute_sql_in_oracle($sql);
					$result = $result_array["flag"];
				}

			?>
			</p>
	      </div>
		</div>
	  <!-- end content --></div>
	  <div id="footer">
	    <div id="footer-pad">
	      <div class="line"></div>
		  <!-- footer and copyright notice -->
	      <p>Design by <a href="http://www.steves-templates.com">Steve's free website templates</a>.</p>
		  <!-- end footer and copyright notice -->
	    </div>
	  </div>
	</div>
  </body>
</html>

